@inherits FshComponentBase
<MudPagination Page="@Page"
               PageSize="@PageSize"
               PageSizeOptions="@PageSizeOptions"
               HideNext="false"
               HidePrev="false"
               HideEllipses="false"
               OnPageChanged="OnPageChangedHandler"
               OnPageSizeChanged="OnPageSizeChangedHandler" />

@code {
    [Parameter] public int Page { get; set; } = 1;
    [Parameter] public int PageSize { get; set; } = 10;
    [Parameter] public int[] PageSizeOptions { get; set; } = new[] { 10, 20, 50 };
    [Parameter] public EventCallback<int> PageChanged { get; set; }
    [Parameter] public EventCallback<int> PageSizeChanged { get; set; }

    private async Task OnPageChangedHandler(int page)
    {
        Page = page;
        if (PageChanged.HasDelegate)
        {
            await PageChanged.InvokeAsync(page);
        }
    }

    private async Task OnPageSizeChangedHandler(int size)
    {
        PageSize = size;
        if (PageSizeChanged.HasDelegate)
        {
            await PageSizeChanged.InvokeAsync(size);
        }
    }
}
